Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/#71 refactor tests using msw #107

Merged
merged 6 commits into from
Nov 20, 2023

Conversation

kylejwatson
Copy link
Contributor

Description

Added msw to avoid mocking services and test UI closer to real usage.
Adds tests for GroupDataService so that we have full coverage.

Issue

This PR addresses issue #71.

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • I have ran the linting and formatting scripts to make sure the code is consistently styled.
  • I have built/compiled and ran the tests to make sure the code works correctly.
  • I have added or changed tests to cover new or different functionality, where applicable.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Add msw to mock backend and avoid mocking the service.
Simplify some test cases by checking for only the needed elements.
Add error handling to the data service.

Addresses #71
Use msw to add group data service tests and remove the ignore comment.a

Addresses #71
Move test setup files out of source folder to avoid needing dependencies instead of dev dependencies
when compiling typescript.

Addresses #71
@kylejwatson kylejwatson requested a review from duke-b November 16, 2023 10:40
Downgrade msw to be inline with backstage setup and make it work with the tsconfig.

Addresses #71
Add reusable consts for testing urls to mock with msw and supply in mock config

Addresses #71
duke-b
duke-b previously approved these changes Nov 20, 2023
Copy link
Contributor

@duke-b duke-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

So that we can check for the exact decimal used from the response.
Should help make the test a bit clearer.

Addresses #71
Copy link
Contributor

@duke-b duke-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@kylejwatson kylejwatson merged commit a5e1fb1 into main Nov 20, 2023
2 checks passed
@kylejwatson kylejwatson deleted the chore/#71-refactor-tests-using-msw branch November 20, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants